class MachineGrid
  include Mongoid::Document
  include Mongoid::Timestamps

  field :status, type: String, default: 'offline'

  belongs_to :machine
  belongs_to :grid
  belongs_to :product

  def status_text
    case status
    when 'offline'
      '下线'
    when 'online'
      '上线'
    end
  end
end
